package TransactionImplementation

import (
	"SPC/AbstractTransactions"
	"SPC/Model"
	"SPC/ModelImplementation"
)

type AddHourlyEmployee struct {
	AbstractTransactions.AddEmployeeTransaction
	itsHourlyRate float64
}

func NewAddHourlyEmployee(empid int, name string, address string, hourlyRate float64) *AddHourlyEmployee {
	n := &AddHourlyEmployee{
		*AbstractTransactions.NewAddEmployeeTransaction(empid, name, address),
		hourlyRate,
	}
	//将子类的方法传递给父类（基类）
	n.AddEmployeeTransaction.GetClassification = n.GetClassification
	n.AddEmployeeTransaction.GetSchedule = n.GetSchedule
	return n
}

func (a *AddHourlyEmployee) GetClassification() Model.PaymentClassification {
	return ModelImplementation.NewHourlyClassification(a.itsHourlyRate)
}

func (a *AddHourlyEmployee) GetSchedule() Model.PaymentSchedule {
	return &ModelImplementation.WeeklySchedule{}
}
